<script>
  import {useHead} from '@vueuse/head'
  export default {
    setup() {
      // 设置标题、图标、主题颜色
      useHead({
        title: 'WFB',
        link: [
          { rel: 'icon', type: 'image/png', href: '/assets/fish/fish1.png' }
        ],
        meta: [
          { name: 'theme-color', content: '#ff0000' }
        ]
      })
    },
    name: 'app',
    provide() {
      return {
        reload: this.reload
      }
    },
    data() {
      return {
        isRouterAlive: true
      }
    },
    methods: {
      reload() {
        this.isRouterAlive = false
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      }
    }
  }
</script>

<template>
  <div id="app">
    <RouterView v-if="this.isRouterAlive"></RouterView>
  </div>
</template>

<style scoped>
html,
body,
#app {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
</style>
